import request from "@/libs/request";

export function login(username,password,t,code){
  const grant_type = 'password'
  const scope = 'server'
  return request({
    url:'/auth/login',
    method:'post',
    params:{ username, password, t, code,grant_type, scope},
    headers:{
      'Authorization':'Basic YW50ZDoxMjM0NTY='
    }
  })
}

export function logout(){
  return request({
    url:'/auth/logout',
    method:'post'
  })
}
export function sendCode(mobile){
  return request({
    url:`/sys/sms/sendSms/${mobile}`,
    method:'get'
  })
}
export function smsCodeLogin(mobile,smsCode){
  return request({
    url:'/auth/mobile/login',
    method:'post',
    params:{mobile:mobile,smsCode:smsCode},
    headers:{
      'Authorization':'Basic YW50ZDoxMjM0NTY='
    }
  })
}
export function sendEmailCode(email){
  return request({
    url:`/sys/email/sendEmailCode`,
    method:'get',
    params:{email:email}
  })
}
